<script type="text/javascript">
	function initialize() {
		var latlng = new google.maps.LatLng(40.396764, -3.713379);
		var myOptions = {
			zoom : 6,
			center : latlng,
			mapTypeId : google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById("map_canvas"),
				myOptions);

		<g:each in="${icons}" var="icon" status="i">
			var contentString_${i} = '<div class="energyType">${message(code:"energy.renewable." + icon.renewable)}</div>' +
									'<div class="region">Región: ${icon.productionInfo.region}</div>' +
									'<div class="pruduction">Producción (MWh): ' +
									<g:if test="${icon.renewable}">
										'${formatNumber(format:'###,###', number:icon.productionInfo.renewable)}' +
									</g:if>
									<g:else>
										'${formatNumber(format:'###,###', number:icon.productionInfo.noRenewable)}' +
									</g:else>
									'</div>';
			var infowindow_${i} = new google.maps.InfoWindow({
			    content: contentString_${i}
			});
			
			var image_${i} = '${icon.image}';
			var markerLatLng_${i} = new google.maps.LatLng('${icon.lat}', '${icon.lng}');
			
			var marker_${i} = new google.maps.Marker({
			      position: markerLatLng_${i},
			      map: map,
			      icon: image_${i}
			});
			
			google.maps.event.addListener(marker_${i}, 'click', function() {
				infowindow_${i}.open(map, marker_${i});
			});
		</g:each>
	}

	$(document).ready(function() {
		initialize();
	});
</script>
<div id="map_canvas" style="width: 652px; height: 456px"></div>